package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.ProductCondition;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

public class GxProductCondition extends ProductCondition {
    public GxProductCondition(Element element) {
        if (element.getElementsByTagName("Attribute").getLength() > 0 &&
            element.getElementsByTagName("Attribute").item(0).getChildNodes().getLength() > 0) {
            this.setAttribute(((Node) element.getElementsByTagName("Attribute").item(0).getChildNodes().item(0)).getNodeValue());
        }
        if (element.getElementsByTagName("Operand").getLength() > 0 &&
            element.getElementsByTagName("Operand").item(0).getChildNodes().getLength() > 0) {
            this.setOperand(((Node) element.getElementsByTagName("Operand").item(0).getChildNodes().item(0)).getNodeValue());
        }
    }
}
